import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import i18n from '@/i18n'

import 'element-ui/lib/theme-chalk/index.css';
import Element from 'element-ui' //element-ui组件
Vue.use(Element, {
    i18n: (key, value) => i18n.t(key, value)
})

import 'font-awesome/css/font-awesome.min.css' //图标字体库和CSS框架

import 'vue-m-message/dist/index.css'
import Message from 'vue-m-message' //Vue全局消息提醒插件
Vue.use(Message, {name: 'msg'}) // `Vue.prototype.$msg` 全局消息提示

import axios from 'axios' //异步交互插件
Vue.prototype.$axios = axios

import Md_Katex from '@iktakahiro/markdown-it-katex' //markdown编辑器插件
// 注释表示使用cdn引入
import 'xe-utils' //通用函数库

import 'vxe-table/lib/style.css'
import VXETable from 'vxe-table' //表格组件
VXETable.setup({
    // 对组件内置的提示语进行国际化翻译
    i18n: (key, value) => i18n.t(key, value)
})
Vue.use(VXETable)

import VueClipboard from 'vue-clipboard2' //剪切板插件
Vue.use(VueClipboard)

import VueCropper from 'vue-cropper'//图片裁剪插件
Vue.use(VueCropper)

import VueParticles from 'vue-particles' //粒子背景插件
Vue.use(VueParticles)

import VueDOMPurifyHTML from 'vue-dompurify-html'//防止XSS攻击
Vue.use(VueDOMPurifyHTML)

import SlideVerify from 'vue-monoplasty-slide-verify' //滑动验证器插件
Vue.use(SlideVerify)


import ECharts from 'vue-echarts/components/ECharts.vue'
import 'echarts/lib/chart/bar'
import 'echarts/lib/chart/line'
import 'echarts/lib/chart/pie'
import 'echarts/lib/component/title'
import 'echarts/lib/component/grid'
import 'echarts/lib/component/dataZoom'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/toolbox'
import 'echarts/lib/component/markPoint'
Vue.component('ECharts', ECharts)
//import VueECharts from 'vue-echarts'//使用CDN的方式如下引入echarts数据可视化插件
//Vue.component('ECharts', VueECharts)

import 'mavon-editor/dist/css/index.css';
import mavonEditor from 'mavon-editor'   //markdown富文本编辑器
Vue.use(mavonEditor)
Vue.prototype.$markDown = mavonEditor.mavonEditor.getMarkdownIt().use(Md_Katex)  // 挂载到vue

import 'muse-ui/dist/muse-ui.css';
import MuseUI from 'muse-ui'//Material Design UI组件库
Vue.use(MuseUI);

import Katex from '@/common/katex' //数学公式排版库
Vue.use(Katex)

import highlight from '@/common/highlight' //语法高亮库
Vue.use(highlight)

//全局过滤器
import filters from '@/common/filters.js'
Object.keys(filters).forEach(key => {   // 注册全局过滤器
    Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

new Vue({
    router, store, i18n, render: h => h(App)
}).$mount('#app')
